package com.gzz.orchid.common.boot.mybatis.dbraw;

import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

/**
 * @author higmd
 */
public interface RawMapper<T> {
    // 新增
   @InsertProvider(type = RawProvider.class, method = "dynamicInsertSql")
    int insert(Object entity);

   // 更新
   @UpdateProvider(type = RawProvider.class, method = "dynamicUpdateSql")
    int update(Object entity);

    // 删除
    @DeleteProvider(type = RawProvider.class, method = "dynamicDeleteSQL")
    int delete(Object entity);

    // 查询
    @SelectProvider(type = RawProvider.class, method = "dynamicSelectSQL")
    <E> E selectOne(Object entity);
}
